package com.briup.day18;

import java.io.Serializable;

/**
 * transient 可以忽略序列化信息
 * 序列化一个Student对象 1.必须类实现序列化接口
 * @author lining
 * @date 2024/1/30 11:14
 */
public class Student implements Serializable {
    //反序列化时，判断字节码版本号是否相同 固定值表示
    public static final long serialVersionUID = 1L;
    private int id;
    private String name;
    transient private String address;
    //密码  账户金额

    public Student() {
    }

    public Student(int id, String name, String address) {
        this.id = id;
        this.name = name;
        this.address = address;
    }

    public Student(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='"  + '\'' +
                ", address='" + address + '\'' +
                '}';
    }
}
